﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebUI.BL.News;
using WebUI.DAL;

namespace WebUI.AdminSite.News
{
    public partial class NewCategoryCreate : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                NewsCategoryBL newCategoryBL = new NewsCategoryBL();
                tbl_NewsCategory newCategory = new tbl_NewsCategory();
                newCategory.Status = drpStatus.SelectedValue;
                newCategory.Description = txtDesc.Text;
                newCategory.CreatedUser = Request.Cookies["adler_userid"].Value;
                newCategory.CreatedDate = Convert.ToDateTime(txtDatePicker.Text);
                newCategory.CategoryName = txtCategoryName.Text;
                newCategoryBL.clsNewcategoryInsert(newCategory);
                Response.Redirect(Helpers.link.toAdminNewsCategory("NewsCategory.aspx"));
            }
            catch(Exception ex)
            {
               
            }
                    
        }
    }
}